﻿using System;
using System.Collections.Generic;

using Rarous.TexyNet;

using Xunit;

namespace Rarous.TexyNet.Test {

  /// <summary>
  /// This is a test class for TagTest and is intended
  /// to contain all TagTest Unit Tests
  /// </summary>
  public class TagTest {

    /// <summary>
    /// A test for NameTest
    /// </summary>
    [Fact]
    public void Tag_Name_PropertyBehavior() {
      Tag target = new Tag();
      string expected = "strong";
      target.Name = expected;

      Assert.Equal(expected, target.Name);
    }

    /// <summary>
    /// A test for AttributesTest
    /// </summary>
    [Fact]
    public void Tag_Attributes_CollectionBehavior() {
      Tag target = new Tag();

      Assert.NotNull(target.Attributes, "Initialize Attributes collection.");

      target.Attributes.Add("title");

      Assert.Equal(1, target.Attributes.Count);
    }

    /// <summary>
    /// A test for TagConstructorTest1
    /// </summary>
    [Fact]
    public void Tag_Constructor_Default() {
      Tag target = new Tag();

      Assert.Equal(String.Empty, target.Name, "Name is not set to empty string.");
      Assert.NotNull(target.Attributes, "Initialize Attributes collection.");
    }

    /// <summary>
    /// A test for TagConstructorTest
    /// </summary>
    [Fact]
    public void Tag_Constructor_Name() {
      string name = "strong";
      Tag target = new Tag(name);

      Assert.Equal(name, target.Name);
      Assert.NotNull(target.Attributes);
    }
  }
}
